package com.qf.utils;

import lombok.Data;

@Data
public class ResultVO {
    private String code; // 查询结果编码，成功为10000，其他为失败
    private String desc; // 失败描述
    private Object data; // 成功数据

    private ResultVO() {
    }

    public static ResultVO createSuccessJsonResult(Object data) {
        ResultVO vo = new ResultVO();
        vo.code = "10000";
        vo.data = data;
        return vo;
    }

    public static ResultVO createFailJsonResult(String code, String desc) {
        ResultVO vo = new ResultVO();
        vo.code = code;
        vo.desc = desc;
        return vo;
    }
}